package co.com.inventarios.persistencia;

import java.util.List;
import java.util.logging.Level;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import co.com.inventarios.modelo.Catvtapro;

public class QueryCatvtaproDAO {
	
	private EntityManager getEntityManager() {
		return EntityManagerHelper.getEntityManager();
	}

	public List<Catvtapro> findCataventaPro_list(String catalogo) {
		EntityManagerHelper.log("finding Catvtapro instance with id: " + catalogo,
				Level.INFO, null);
		try {
			    getEntityManager().clear();
				final String queryString = "select model from  Catvtapro model where "
				+ " model.id.cvpcatalog = '" + catalogo + "'  "+"  ";	
				Query query = getEntityManager().createQuery(queryString);
				return query.getResultList();
						
		} catch (RuntimeException re) {
			EntityManagerHelper.log("find by property name failed",
					Level.SEVERE, re);
			throw re;
		}
	}
	
	
}
